package com.atguigu.gulimall.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @create: 2024/9/5
 * @author: gyhe10
 * @description: gulimall项目自定义 Spring MVC 配置类
 **/

@Configuration
public class GulimallWebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        // 配置了两个视图控制器：将"/login.html" URL映射到"login"视图，将"/reg.html" URL映射到"reg"视图
        // 这使得访问这些 URL 时直接显示对应的页面。
        // registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/reg.html").setViewName("reg");
    }
}
